package com.freewater.springboot.demo;

public class PackageUtils {
    /**
     * 获取Class相对于classpath的路径
     */
    public static String getClassPathFroClass(Class<?> clazz) {
        return clazz.getPackage().getName().replaceAll("\\.", "/");
    }

    /**
     * 获取默认的ApplicationContext的xmlPath
     */
    public static String getDefaultAppContextXmlPath(Class<?> clazz) {
        return "classpath:" + getClassPathFroClass(clazz) + "/applicationContext.xml";
    }
}
